/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Schedule;

import DataModel.*;
import Schedule.DataLayer.ScheduleDataManager;
import java.util.Date;

/**
 *
 * @author Rainiero
 */
public class ScheduleManager {

    // <editor-fold defaultstate="collapsed" desc="Singleton">
    private static ScheduleManager _instance = new ScheduleManager();

    private ScheduleManager()
    {
    }

    public static ScheduleManager GetInstance()
    {
        return _instance;
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Public Methods">
    public void RegisterAdvance(int activityId, Date date, double advance, double spentBudget)
    {
        ScheduleDataManager.GetInstance().RegisterAdvance(activityId, date, advance, spentBudget);
    }

    public Advance[] GetAdvances(int activityId)
    {
        return ScheduleDataManager.GetInstance().GetAdvances(activityId);
    }

    public Activity GetActivity(int activityId)
    {
        return ScheduleDataManager.GetInstance().GetActivity(activityId);
    }

    public ActivitySummary[] GetCurrentSchedule(int projectId)
    {
        int scheduleId = -1;
        scheduleId = ScheduleDataManager.GetInstance().GetLastSchedule(projectId);
        return GetSchedule(scheduleId);
    }

    public ActivitySummary[] GetSchedule(int scheduleId)
    {
        return ScheduleDataManager.GetInstance().GetSchedule(scheduleId);
    }
    // </editor-fold>

}
